<template>
  <div>
    请选择添加任务
    <el-row>
      <el-col :span="8" :offset="3">
        <el-card :body-style="{ padding: '0px' }">
          <img src="../assets/pic1.png" class="image">
          <div style="padding: 14px;">
            <span>自定义规则，对指定网页进行精确匹配</span>
            <div class="bottom clearfix">
              <el-button type="text" class="button" @click="addTabs('1-6','精确建库')">精确建库</el-button>
            </div>
          </div>
        </el-card>
      </el-col>
      <el-col :span="8" :offset="2">
        <el-card :body-style="{ padding: '0px' }">
          <img src="../assets/pic2.png" class="image">
          <div style="padding: 14px;">
            <span>根据关键字，对标签进行搜索</span>
            <div class="bottom clearfix">
              <el-button type="text" class="button" @click="addTabs('1-7','标签寻址')">标签寻址</el-button>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
    <el-row style="margin-top: 20px">
      <el-col :span="8" :offset="3">
        <el-card :body-style="{ padding: '0px' }">
          <img src="../assets/pic3.png" class="image">
          <div style="padding: 14px;">
            <span>自定义规则，爬取58同城房源信息</span>
            <div class="bottom clearfix">
              <el-button type="text" class="button" @click="addTabs('1-8','指定寻址')">指定寻址</el-button>
            </div>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>

</template>

<style>

  .bottom {
    margin-top: 13px;
    line-height: 12px;
  }

  .button {
    padding: 0;
    float: right;
  }

  .image {
    width: 100%;
    display: block;
  }

  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }

  .clearfix:after {
    clear: both
  }
</style>

<script>
  export default {
    data () {
      return {
        currentDate: new Date()
      }
    },
    methods: {
      addTabs (key, title) {
        this.$store.dispatch('addTab', {'tab': {
          title: title,
          name: key,
          components: key,
          closed: true
        },
          'activeName': key})
      }
    }
  }
</script>
